package com.ccys.cms.controller.userManagement;

import com.ccys.cms.service.userManagement.TblPlanBenefitMemberWebService;
import com.ccys.common.constants.ContextConstants;
import com.ccys.common.util.Kit;
import com.ccys.common.vo.ResponseResult;
import com.ccys.db.dto.userManagement.TblPlanBenefitMemberDTO;
import com.ccys.db.entity.TblPlanBenefit;
import com.ccys.db.entity.TblPlanBenefitMember;
import com.ccys.db.vo.userManagement.*;
import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@RestController
@Api(tags = "用户管理-病人-Benefits")
@RequestMapping("userManagement")
@CrossOrigin(methods = {RequestMethod.GET, RequestMethod.POST, RequestMethod.DELETE, RequestMethod.PUT}) // 开启跨域访问允许
@SuppressWarnings("unchecked")
public class PlanBenefitMemberWebController {

    @Autowired
    private TblPlanBenefitMemberWebService tblPlanBenefitMemberWebService;

    @GetMapping("planBenefitMember")
    @ApiOperation("获取Benefit相关列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "memId", value = "memId", required = false, dataType = "string", paramType = "query"),
        @ApiImplicitParam(name = "type", value = "type(1:AIA corporate;2:Direct corporate;3:AIA Healthshield)", required = false, dataType = "string", paramType = "query"),
    })
    @ApiResponses({
            @ApiResponse(code = 411, message = ContextConstants.DESC_411),
            @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = MemberPlanListWebVO.class)
    })
    public ResponseResult listObjectsCms(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblPlanBenefitMemberDTO dto) {
        return this.tblPlanBenefitMemberWebService.listObjectsCms(request, response, dto);
    }

    @GetMapping("planBenefitMember/subscription")
    @ApiOperation("获取BenefitSubscription类型查询相关列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "memId", value = "memId", required = false, dataType = "string", paramType = "query"),
    })
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = MemberBenefitSubscriptionListWebVO.class)
    })
    public ResponseResult listBenefitSubscription(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblPlanBenefitMemberDTO dto) {
        return this.tblPlanBenefitMemberWebService.listBenefitSubscription(request, response, dto);
    }

    @GetMapping("planBenefitMember/listBenefitEAP")
    @ApiOperation("获取BenefitEAP相关列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "memId", value = "memId", required = false, dataType = "string", paramType = "query"),
    })
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = MemberBenefitsEAPListWebVO.class)
    })
    public ResponseResult listBenefitEAP(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblPlanBenefitMemberDTO dto) {
        return this.tblPlanBenefitMemberWebService.listBenefitEAP(request, response, dto);
    }


    @GetMapping("planBenefitMember/listBenefitCDMP")
    @ApiOperation("获取BenefitCDMP相关列表")
    @ApiImplicitParams({
        @ApiImplicitParam(name = "memId", value = "memId", required = false, dataType = "string", paramType = "query"),
    })
    @ApiResponses({
        @ApiResponse(code = 411, message = ContextConstants.DESC_411),
        @ApiResponse(code = 200, message = ContextConstants.MODEL_DESC,response = MemberBenefitsCDMPListWebVO.class)
    })
    public ResponseResult listBenefitCDMP(HttpServletRequest request, HttpServletResponse response, @ApiIgnore TblPlanBenefitMemberDTO dto) {
        return this.tblPlanBenefitMemberWebService.listBenefitCDMP(request, response, dto);
    }





}